<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%>
<%@page import="cn.egame.common.model.PageData"%>
<%@page import="java.util.List"%>
<%@page import="cn.egame.interfaces.gc.TerminalInfo"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/main.css"/>
<title>机型适配列表</title>
<%
	int activityid = 0;
	if (request.getAttribute("activityid") != null) {
		activityid = (Integer) request.getAttribute("activityid");
	}
	int mid = 0;
	if(request.getAttribute("mid")!=null){
		mid = (Integer)request.getAttribute("mid");
	}
%>

</head>
<body>
<form id="myform" action="<%=request.getContextPath() + "/tv/activity/adapt.do" %>">
	<input type="hidden" name="id" value=<%=activityid%>>
	<input name=mid type="hidden"  value=<%=mid %>>
	<table cellpadding="0" cellspacing="0" class="table2">
		<tr>
			<td colspan=6>
				<select id="notAdapted" name="notAdapted">
					<option value="0">请选择</option>
		<%
			List<TerminalInfo> notAdaptList = new ArrayList<TerminalInfo>();
			if(request.getAttribute("notAdaptList")!=null){
				notAdaptList = (List<TerminalInfo>)request.getAttribute("notAdaptList");
				for(TerminalInfo bean:notAdaptList){
					%>
						<option value="<%=bean.getTerminalId() %>">
							<%=bean.getTerminalName() %>--
							<%=bean.getUACode() %>
						</option>
					<%
				}
			}
				
		%>
				</select>
				<input type="submit" value="适配机型" class="btn3">
			</td>
		</tr>
		
		<tr>
			<th>序号</th>
			<th>品牌</th>
			<th>型号</th>
			<th>客户端UA</th>
			<th>分辨率</th>
			<th>操作</th>
		</tr>
		<%		
		if(request.getAttribute("pd") != null){
			PageData pd = (PageData)request.getAttribute("pd");
			List<TerminalInfo> list = (List<TerminalInfo>)pd.getContent();
			if(list != null){
				int i = 1;
				for(TerminalInfo bean: list){
					%>
		<tr>
			<td><%=i++ %></td>
			<td><%=bean.getTerminalName() %></td>
			<td><%=bean.getShortUA() %></td>
			<td><%=bean.getUACode() %></td>
			<td><%=bean.getScreenPx() %></td>
			<td>
				<a href="<%=request.getContextPath() + "/tv/activity/adapt/delete.do?terminalid=" + bean.getTerminalId() + "&id=" + activityid %>">取消适配</a>
			</td>
		</tr>
		<%
				}
			}			
		}
		
	%>
	</table>
	<%@ include file="../page.in"%>
</form>
</body>
</html>